import * as util from '../common/util.js'

function getAjax(arams,request,callback) {
	
	util.getAjax(arams, request, function (data) {
		// console.log(JSON.stringify(data));
		if (data.code == 0) {
			callback(data);
		}else if(data.code == 9100){
			uni.showToast({
				icon:'none',
				title:'您的账号在别的地方登陆,请重新登陆'
			})
			uni.removeStorageSync('cwg_loginInfos')
			uni.reLaunch({
				url:'/pages/login/login'
			})
		}else {
			uni.showToast({
				icon:'none',
				title:data.msg
			})
		}
	});
	
}

export default getAjax;